/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sqlserver;

/**
 *
 * @author BEHIEN
 */

public class Column {
	private String ColumnName="";
	private String ColumnType="";
	private String DBName="";
	private String TableName="";
	public static final String StringType = "String";
	public static final String IntType = "int";
	
	public Column(String dbName,String tbName,String ColumnName, String columnType)throws IllegalArgumentException 
	{
		if (columnType.equals(StringType) || columnType.equals(IntType))
		{
			this.DBName=dbName;
			this.TableName=tbName;
			this.ColumnName=ColumnName;
			this.ColumnType = columnType;
		}
		else
			throw new IllegalArgumentException("Invalid type. Type has to be Column.StringType or Column.IntType");
	}
	
	public String getColumnName() {
		return ColumnName;
	}

	public void setColumnName(String columnName) {
		this.ColumnName = columnName;
	}

	public String getColumnType() {
		return ColumnType;
	}

	public void setColumnType(String type) throws IllegalArgumentException {
		if (type.equals(StringType) || type.equals(IntType))
			this.ColumnType = type;
		else
			throw new IllegalArgumentException("Invalid type");
	}

	public String getDBName() {
		return DBName;
	}

	public void setDBName(String name) {
		DBName = name;
	}

	public String getTableName() {
		return TableName;
	}

	public void setTableName(String tableName) {
		TableName = tableName;
	}
	
}
